package com.talkingdata.hadoop.guard.bean;


import org.springframework.stereotype.Component;

@Component
public class DfsClusterState {

    private long id;                          // 编号
    private String serviceId;                 // 集群namespace 名称
    private String isSafemode;                // 处于安全模式
    private String isSecurity;                // 是否启动安全机制
    private String activeNamenode;            // 活跃的namenode节点
    private long capacity;                    // 总容量
    private String capacityByteDesc;          // 单位换算后总容量
    private long totalBlocks;                 // 集群block数量
    private long totalFiles;                  // 集群文件统计
    private double percentUsed;               // 使用率 %
    private long missingBlocks;               // 数据块丢失
    private long underReplicatedBlocks;       // 在复制的数据块
    private long numLiveDatanodes;            // 活跃 datanode 节点数
    private long numDeadDatanodes;            // 故障 datanode 节点数
    private long numDecomLiveDatanodes;       // 在下架 datanode 节点数
    private long numDecomDeadDatanodes;       // 挂掉的下架的 datanode 节点数
    private String version ;                  // 版本
    private String timestamp;                 // 时间戳

    public DfsClusterState() {
    }

    public String getVersion() {
        return version;
    }

    public void setVersion(String version) {
        this.version = version;
    }

    public DfsClusterState(long id, String serviceId, String isSafemode, String isSecurity, String activeNamenode, long capacity, String capacityByteDesc, long totalBlocks, long totalFiles, double percentUsed, long missingBlocks, long underReplicatedBlocks, long numLiveDatanodes, long numDeadDatanodes, long numDecomLiveDatanodes, long numDecomDeadDatanodes, String version, String timestamp) {
        this.id = id;
        this.serviceId = serviceId;
        this.isSafemode = isSafemode;
        this.isSecurity = isSecurity;
        this.activeNamenode = activeNamenode;
        this.capacity = capacity;
        this.capacityByteDesc = capacityByteDesc;
        this.totalBlocks = totalBlocks;
        this.totalFiles = totalFiles;
        this.percentUsed = percentUsed;
        this.missingBlocks = missingBlocks;
        this.underReplicatedBlocks = underReplicatedBlocks;
        this.numLiveDatanodes = numLiveDatanodes;
        this.numDeadDatanodes = numDeadDatanodes;
        this.numDecomLiveDatanodes = numDecomLiveDatanodes;
        this.numDecomDeadDatanodes = numDecomDeadDatanodes;
        this.version = version;
        this.timestamp = timestamp;
    }
    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }


    public String getServiceId() {
        return serviceId;
    }

    public void setServiceId(String serviceId) {
        this.serviceId = serviceId;
    }

    public String getIsSafemode() {
        return isSafemode;
    }

    public void setIsSafemode(String isSafemode) {
        this.isSafemode = isSafemode;
    }


    public String getIsSecurity() {
        return isSecurity;
    }

    public void setIsSecurity(String isSecurity) {
        this.isSecurity = isSecurity;
    }


    public String getActiveNamenode() {
        return activeNamenode;
    }

    public void setActiveNamenode(String activeNamenode) {
        this.activeNamenode = activeNamenode;
    }


    public long getCapacity() {
        return capacity;
    }

    public void setCapacity(long capacity) {
        this.capacity = capacity;
    }


    public String getCapacityByteDesc() {
        return capacityByteDesc;
    }

    public void setCapacityByteDesc(String capacityByteDesc) {
        this.capacityByteDesc = capacityByteDesc;
    }


    public long getTotalBlocks() {
        return totalBlocks;
    }

    public void setTotalBlocks(long totalBlocks) {
        this.totalBlocks = totalBlocks;
    }


    public long getTotalFiles() {
        return totalFiles;
    }

    public void setTotalFiles(long totalFiles) {
        this.totalFiles = totalFiles;
    }


    public double getPercentUsed() {
        return percentUsed;
    }

    public void setPercentUsed(double percentUsed) {
        this.percentUsed = percentUsed;
    }


    public long getMissingBlocks() {
        return missingBlocks;
    }

    public void setMissingBlocks(long missingBlocks) {
        this.missingBlocks = missingBlocks;
    }


    public long getUnderReplicatedBlocks() {
        return underReplicatedBlocks;
    }

    public void setUnderReplicatedBlocks(long underReplicatedBlocks) {
        this.underReplicatedBlocks = underReplicatedBlocks;
    }


    public long getNumLiveDatanodes() {
        return numLiveDatanodes;
    }

    public void setNumLiveDatanodes(long numLiveDatanodes) {
        this.numLiveDatanodes = numLiveDatanodes;
    }


    public long getNumDeadDatanodes() {
        return numDeadDatanodes;
    }

    public void setNumDeadDatanodes(long numDeadDatanodes) {
        this.numDeadDatanodes = numDeadDatanodes;
    }


    public long getNumDecomLiveDatanodes() {
        return numDecomLiveDatanodes;
    }

    public void setNumDecomLiveDatanodes(long numDecomLiveDatanodes) {
        this.numDecomLiveDatanodes = numDecomLiveDatanodes;
    }


    public long getNumDecomDeadDatanodes() {
        return numDecomDeadDatanodes;
    }

    public void setNumDecomDeadDatanodes(long numDecomDeadDatanodes) {
        this.numDecomDeadDatanodes = numDecomDeadDatanodes;
    }


    public String getTimestamp() {
        return timestamp;
    }

    public void setTimestamp(String timestamp) {
        this.timestamp = timestamp;
    }

    @Override
    public String toString() {
        return "DfsClusterState{" +
                "id=" + id +
                ", serviceId='" + serviceId + '\'' +
                ", isSafemode='" + isSafemode + '\'' +
                ", isSecurity='" + isSecurity + '\'' +
                ", activeNamenode='" + activeNamenode + '\'' +
                ", capacity=" + capacity +
                ", capacityByteDesc='" + capacityByteDesc + '\'' +
                ", totalBlocks=" + totalBlocks +
                ", totalFiles=" + totalFiles +
                ", percentUsed=" + percentUsed +
                ", missingBlocks=" + missingBlocks +
                ", underReplicatedBlocks=" + underReplicatedBlocks +
                ", numLiveDatanodes=" + numLiveDatanodes +
                ", numDeadDatanodes=" + numDeadDatanodes +
                ", numDecomLiveDatanodes=" + numDecomLiveDatanodes +
                ", numDecomDeadDatanodes=" + numDecomDeadDatanodes +
                ", version='" + version + '\'' +
                ", timestamp='" + timestamp + '\'' +
                '}';
    }
}
